<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>加盟碳银产业协同平台</title>
    <link rel="stylesheet" href="/ace/180715/style.css">
</head>
<body>
<div class="layer1">
    <div class="contain">
        <div class="tit">
            <div class="tip"><img class="img-block" src="/ace/180715/20.png" alt=""></div>
            <img class="img-block" src="/ace/180715/01.png" alt="">
        </div>
        <a class="btn j_goLayer5">
            <img class="img-block" src="/ace/180715/19.jpg" alt="">
        </a>
        <div class="txt">浙江碳银是具有国资背景行业领先的清洁能源投资与利用综合服务平台。自进军光伏领域以来，已在多个地区实施了户用光伏和工商业光伏项目。</div>
        <div class="tip">
            <img class="img-block" src="/ace/180715/02.png" alt="">
        </div>
    </div>
</div>
<div class="layer2">
    <div class="layer-title t1">加盟方式</div>
    <div class="bg1">
        <div class="contain">
            <img class="img-block" src="/ace/180715/04.png" alt="">
        </div>
    </div>
    <div class="bg2">
        <div class="contain">
            <img class="img-block" src="/ace/180715/05.png" alt="">
        </div>
    </div>
    <div class="bg3">
        <div class="contain">
            <img class="img-block" src="/ace/180715/06.png" alt="">
        </div>
    </div>
</div>
<div class="layer3">
    <div class="tit">高效、便捷的业务协同系统</div>
    <div class="imgs j_ani3">
        <div class="img img1"></div>
        <div class="img img2 j_ani3"></div>
        <div class="img img3 j_ani3"></div>
        <div class="img img4 j_ani3"></div>
        <div class="img img5 j_ani3"></div>
    </div>
</div>
<div class="layer4">
    <div class="layer-title t2">联系我们</div>
    <div class="qrcode"></div>
    <div class="txt">关注公众号了解更多</div>
    <div class="tel">联系电话：400-963-6880</div>
</div>
<div class="layer5">
    <div class="layer-title t3">填写信息</div>
    <div class="tip">(暂限浙江)</div>
    <div class="contain">
        <div class="form">
            <div class="row">
                <div class="col1">
                    <div class="item">
                        <input type="text" id="partner_name" class="text" maxlength="10" placeholder="姓名">
                    </div>
                </div>
                <div class="col1">
                    <div class="item">
                        <input type="tel" id="partner_phone" class="text" maxlength="11" placeholder="手机号">
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col2">
                    <div class="item">
                        <input type="text" id="address" class="text" maxlength="100" placeholder="所属地区（市区县）">
                    </div>
                </div>
            </div>
            <div class="fot">
                <a class="btn" id="j_applySubmit">立即加盟</a>
            </div>
        </div>
    </div>
</div>
<div class="layer6">
    <div class="tit">浙江碳银</div>
</div>
<script src="/ace/js/jquery-1.12.4.min.js"></script>
<script>
    (function ($) {
        $(function () {
            var indexScroll = true;
            initScroll();
            function initScroll() {
                var scrollTop = parseInt($(window).scrollTop());
                var winHeight = parseInt($(window).height());
                var top3 = parseInt($('.layer3').offset().top);
                if (scrollTop > top3 + 740 || scrollTop < top3 + 230 - winHeight) {
                    $('.j_ani3').removeClass('pos');
                } else {
                    $('.j_ani3').addClass('pos');
                }
                setTimeout(function () {
                    indexScroll = true;
                }, 200);
            }

            function getParameter(key) {
                var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
                var r = window.location.search.substr(1).match(reg);
                if (r !== null) return unescape(r[2]);
                return null;
            }

            $(window).on('scroll', function () {
                if (indexScroll) {
                    initScroll();
                    indexScroll = false;
                }
            });
            $('.j_goLayer5').on('click', function () {
                $('body,html').stop(true, true).animate({scrollTop: parseInt($('.layer5').offset().top)}, 500);
            });

            var t = getParameter('t');
            var $partner_name = $('#partner_name');
            var $partner_phone = $('#partner_phone');
            var $address = $('#address');
            var source = '';
            if (t === "9rQrX6ydzDTAQ4fLwUZkAcZ9U8Iqehwtylkc0drTjZZXhvl8qiIclPlpjwNX19Jf") {
                source = '索比光伏网';
            } else if (t === 'ndtWzHfQ5QOMdEVIGoOw2QqmlZBuG6Z7kFDpLb4sTh12dhJDCa0m9GZP1u2vY6b4') {
                source = '北极星光伏网';
            }
            $('#j_applySubmit').on('click', function () {
                if (!$partner_name.val()) {
                    $.toast('请输入姓名');
                    return false;
                }
                var reg;
                if (!$partner_phone.val()) {
                    $.toast('请输入手机号');
                    return false;
                } else {
                    reg = /^0?(13|14|15|17|18)[0-9]{9}$/;
                    if (!reg.test($partner_phone.val())) {
                        $.toast({
                            msg: '手机号格式错误', call: function () {
                                $('#toast').fadeOut(500);
                                $partner_phone.focus();
                            }
                        });
                        return false;
                    }
                }
                if (!$address.val()) {
                    $.toast('请输入所属地区');
                    return false;
                }
                var paras = {};
                paras['partner_name'] = $partner_name.val();
                paras['partner_phone'] = $partner_phone.val();
                paras['address'] = $address.val();
                paras['type'] = 4;
                paras['source'] = source;
                var $t = $(this);
                if (!$t.hasClass('dis')) {
                    $t.addClass('dis');
                    $.ajax({
                        url: 'http://api.crm.tanwin.cn/project/join/partner',
                        data: paras,
                        type: "POST",
                        dataType: "json",
                        async: false,
                        success: function (data) {
                            $t.removeClass('dis');
                            if (data && data.code === 100) {
                                $.toast('提交成功！我们的客服将尽快与您联系，敬请关注！', function () {
                                    $('#partner_name,#partner_phone,#address').val('');
                                });
                            } else {
                                $.toast(data.msg);
                            }
                        },
                        error: function () {
                            $t.removeClass('dis');
                        }
                    });
                }
            });
        });
    })(jQuery);
    (function ($) {
        $.toast = function (options) {
            var $toast = $('#toast');
            var defaults = {
                msg: '', call: function () {
                    $toast.fadeOut(500);
                }
            };
            try {
                if (typeof options === "string" || typeof options === "number") {
                    options = {msg: options};
                }
                var opts = $.extend(defaults, options);
            } catch (e) {
                console.log(e);
            }

            var toastHtml = '<div style="position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;"></div>' +
                '<div style="position:fixed;z-index:5000;width:200px;top:180px;left:50%;margin-left:-100px;background:rgba(17,17,17,.7);text-align:center;border-radius:5px;color:#FFF;"><p style="padding:20px 10px;font-size:18px">' + opts.msg + '</p></div>';
            if ($toast && $toast.length > 0) {
                $toast.html(toastHtml);
            } else {
                $('body').append('<div id="toast" style="position:relative;z-index:9000">' + toastHtml + '</div>');
                $toast = $('#toast');
            }
            $toast.fadeIn(500);
            setTimeout(function () {
                opts.call();
            }, 2000);
        };
    })(jQuery);
</script>
</body>
</html>
